﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebApplication1
{
    public partial class Login : System.Web.UI.Page
    {       
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack )
            {
                Label3.Text = "";
            }
        }

        protected void Button2_Click(object sender, EventArgs e)
        {
            var uid = this.longin.Text.Trim();
            var pwd = this.Password .Text.Trim();
            var sql = string.Format("select * from Users where Usersname={0}", uid);
            var dt = DbHelep.GetData(sql);
            /*if (dt.Rows .Count == 1)
            {
                var item = dt.Rows[0];
                var IsActived = (bool)item.ItemArray[3];
                var IsDelted = (bool)item.ItemArray[4];
                if (IsDelted )
                {
                    Label3.Text = "用户已删除！";
                }else if (IsActived )
                {
                    if (pwd == Password)
                    {
                        Response.Redirect("default.aspx");
                    }else
                    {
                        Label3.Text = "密码错误！";
                    }
                }
            }*/
        }

        protected void Button1_Click(object sender, EventArgs e)
        {

        }
    }
}